package me.zhengjie.minbearwcs.controller.Inbound;

import lombok.RequiredArgsConstructor;
import me.zhengjie.minbearwcs.entity.DTO.transfer.Tuple;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import me.zhengjie.minbearwcs.entity.DTO.pda.PdaCallAgvDTO;
import me.zhengjie.minbearwcs.entity.DTO.response.Resp;
import me.zhengjie.minbearwcs.serivce.inbound.InboundService;

@RestController
@RequestMapping("/pda/inbound")
@RequiredArgsConstructor
public class InboundPdaController {

    private final InboundService inboundService;

    // pda入库呼叫车辆
    @PostMapping("/call/agv")
    public Resp callAgvCommand(@RequestBody PdaCallAgvDTO pdaCallAgvDTO) {
        Tuple<String> tuple = inboundService.receiveCallAgv(pdaCallAgvDTO);
        return Resp.build().code(tuple.success)
                .reason(tuple.value);
    }
}
